//
//  MyShouYiTableViewCell.m
//  ZhiBoYuan
//
//  Created by coder_di on 2018/4/19.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "MyShouYiTableViewCell.h"

@implementation MyShouYiTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //添加UI
        [self addUI];
    }
    return self;
}

-(void)addUI{
    self.imageVC = [[UIImageView alloc]initWithFrame:CGRectMake(20 * KscreenWidth, 20 * KscreenHeight, 150 * KscreenWidth, 100 * KscreenHeight)];
    self.imageVC.layer.masksToBounds = YES;
    //    self.imageVC.userInteractionEnabled = YES;
    self.imageVC.contentMode = UIViewContentModeScaleAspectFill;
    self.imageVC.clipsToBounds = YES;
    //    self.imageVC.layer.cornerRadius = 22.5 * KscreenWidth;
    [self.imageVC setImage:[UIImage imageNamed:@"0009"]];
    //    self.imageVC.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.imageVC];
    
    
    _nameLable  = [[UILabel alloc]initWithFrame:CGRectMake(190 * KscreenWidth, 20 * KscreenHeight, ScreenWidth - 200 * KscreenWidth, 40 * KscreenHeight)];
    _nameLable.font = [UIFont systemFontOfSize:15 * KscreenWidth];
    _nameLable.numberOfLines = 2;
    [self.contentView addSubview:self.nameLable];
    
    
    _timeLable = [[UILabel alloc]initWithFrame:CGRectMake(190 * KscreenWidth, 60 * KscreenHeight, ScreenWidth - 210 * KscreenWidth, 25 * KscreenHeight)];
    _timeLable.text = @"2018-09-09 13:14:50";
    _timeLable.font = [UIFont systemFontOfSize:15 * KscreenWidth];
    _timeLable.textColor = hui3Color;
    [self.contentView addSubview:_timeLable];
    
    _pingtaisyLable = [[UILabel alloc]initWithFrame:CGRectMake(190 * KscreenWidth, 100 * KscreenHeight, 85 *KscreenWidth, 20 * KscreenHeight)];
    _pingtaisyLable.text = @"课程收益";
    _pingtaisyLable.textAlignment = NSTextAlignmentCenter;
    _pingtaisyLable.font = [UIFont systemFontOfSize:15 * KscreenWidth];
    _pingtaisyLable.textColor = [UIColor redColor];
    _pingtaisyLable.layer.borderWidth = 1 * KscreenWidth;
    _pingtaisyLable.layer.borderColor = [[UIColor redColor] CGColor];
    [self.contentView addSubview:_pingtaisyLable];
    
    _douLable = [[UILabel alloc]initWithFrame:CGRectMake(285 * KscreenWidth, 97 * KscreenHeight, 100 *KscreenWidth, 25 * KscreenHeight)];
    _douLable.text = @"300学豆";
    _douLable.font = [UIFont systemFontOfSize:15 * KscreenWidth];
    _douLable.textColor = [UIColor redColor];
    [self.contentView addSubview:_douLable];
    
    _tuiZuoLable = [[UILabel alloc]initWithFrame:CGRectMake(screenWidth - 55 * KscreenWidth , 60 * KscreenHeight, 25 * KscreenWidth, 25 * KscreenHeight)];
    _tuiZuoLable.text = @"推";
    _tuiZuoLable.font = [UIFont systemFontOfSize:16 * KscreenWidth];
    _tuiZuoLable.layer.masksToBounds = YES;
    _tuiZuoLable.layer.cornerRadius = 12.5 * KscreenWidth;
    _tuiZuoLable.layer.borderColor = [[UIColor redColor] CGColor];
    _tuiZuoLable.layer.borderWidth = 1;
    _tuiZuoLable.textAlignment = NSTextAlignmentCenter;
    _tuiZuoLable.textColor = [UIColor redColor];
    [self.contentView addSubview:_tuiZuoLable];
    
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
